﻿* Encoding: UTF-8.
####Coding Headline Selection as Treatment (1) or Control (0)####
    

DATASET ACTIVATE DataSet1.
RECODE Headline (1=0) (2=0) (3=1) (4=0) (5=1) (6=0) (7=1) (8=0) (9=1) (10=0) INTO Select1.
VARIABLE LABELS  Select1 'Select target or control'.
EXECUTE.


####Coding for SDT Trials#####
    
   
####### HIt and Foil Rates for Condition A
    

Create Variable for Condition A (hits)

COMPUTE A_HR=mean(sdt1_AEFH, sdt2_AEFH, sdt3_AEFH, sdt4_AEFH, sdt5_AELH, sdt6_AELH, sdt7_AELH, sdt8_AELH, sdt9_ALH, sdt10_AFH, sdt11_ALH, sdt12_AFH).
VARIABLE LABELS  A_HR 'Condition A Hit rate_mean function'.
EXECUTE.

DATASET ACTIVATE DataSet1.
RECODE A_HR(0=.01).
EXECUTE.

Create Variable for Condition A (foils)

COMPUTE A_FR=mean(sdt1_AHFF, sdt2_AHFF, sdt3_AHFF, sdt4_AHFF, sdt5_AHLF, sdt6_AHLF, sdt7_AHLF, sdt8_AHLF, sdt9_AF, sdt10_AF, sdt11_AF, sdt12_AF).
VARIABLE LABELS  A_FR 'Condition A Foil rate_mean function'.
EXECUTE.

DATASET ACTIVATE DataSet1.
RECODE A_FR(0=.01).
EXECUTE.

####### Hit and Foil Rates for Condition B

Create Variable for Condition B (hits)

COMPUTE B_HR=MEAN(sdt1_BHFH,sdt2_BHFH,sdt3_BHFH,sdt4_BHFH,sdt5_BHLH,sdt6_BHLH,sdt7_BHLH,sdt8_BHLH,
    sdt9_BLH,sdt10_BFH,sdt11_BLH,sdt12_BFH).
EXECUTE.

DATASET ACTIVATE DataSet1.
RECODE B_HR(0=.01).
EXECUTE.

Create Variable for Condition B (foils)

COMPUTE B_FR=MEAN(sdt1_BEFF,sdt2_BEFF,sdt3_BEFF,sdt4_BEFF,sdt5_BELF,sdt6_BELF,sdt7_BELF,sdt8_BELF,
    sdt9_BF,sdt10_BF,sdt11_BF,sdt12_BF).
EXECUTE.

DATASET ACTIVATE DataSet1.
RECODE B_FR(0=.01).
EXECUTE.


#########Combine Hit and Foils across all conditions 
    
DATASET ACTIVATE DataSet1.
COMPUTE HR=sum.1(A_HR,B_HR).
EXECUTE.

DATASET ACTIVATE DataSet1.
COMPUTE FR=sum.1(A_FR,B_FR).
EXECUTE.
 
#########Calculate DPRIME 
    
COMPUTE DPrime_ALL=PROBIT(HR) - PROBIT(FR).
VARIABLE LABELS  DPrime_ALL 'DPrime Across All Conditions'.
EXECUTE.

################Creating Journalist Accuracy Scores on A/B Test Results and comparing to chance accuracy
    

DATASET ACTIVATE DataSet1.
COMPUTE Accuracy=(AB1+AB2+AB3+AB4+AB5+AB6).
EXECUTE.



DATASET ACTIVATE DataSet1.
T-TEST
  /TESTVAL=3
  /MISSING=ANALYSIS
  /VARIABLES=Accuracy
  /ES DISPLAY(TRUE)
  /CRITERIA=CI(.95).

############################## Hypothesis 1: Headline Selection x Condition
    
DATASET ACTIVATE DataSet1.
CROSSTABS
  /TABLES=Cond_all BY Select1
  /FORMAT=AVALUE TABLES
  /STATISTICS=CHISQ 
  /CELLS=COUNT
  /COUNT ROUND CELL.

##############################Hypothesis 2: SDT Task x Condition
    
T-TEST GROUPS=Cond_all(0 1)
  /MISSING=ANALYSIS
  /VARIABLES=DPrime_ALL
  /ES DISPLAY(TRUE)
  /CRITERIA=CI(.95).


DESCRIPTIVES VARIABLES=DPrime_ALL
  /STATISTICS=MEAN STDDEV MIN MAX.



